<!--/*@thymesVar id="cashboxUnits" type="java.util.List<com.weirong.smartvault.backservice.entity_model.CashboxUnitModel>"*/-->
<div class="well well-lg" style="margin-bottom: 0px;">
    <div align="right" style="margin-bottom:10px">
        <button class="btn btn-primary" data-toggle="modal" data-target=".parent-type">新增</button>
    </div>
    <table class="table table-bordered" style="margin-bottom: 0px;">
        <tr class="info" width="100%">
            <th width="7%">序号</th>
            <th width="12%">钞箱组编码</th>
            <th width="12%">钞箱组名称</th>
            <th>描述</th>
            <th width="17%">操作</th>
        </tr>
        <tr th:each="unit,iterstat:${cashboxUnits}">
            <td th:text="${iterstat.index}">1</td>
            <td th:text="${unit.getNo()}">1</td>
            <td th:text="${unit.getName()}">1#</td>
            <td th:text="${unit.getDescription()}">1#钞箱组</td>
            <td><a href="#" data-toggle="modal" th:attr='data-target=${".child-type"+unit.getId()}'>修改</a>
                &nbsp;&nbsp;<a th:href="@{/API/cashUnitDelete(id=${unit.getId()})}">删除</a>
                &nbsp;&nbsp;<a href="#" data-toggle="modal"
                               th:attr="data-target=${'.denomination'+unit.getId()}">查看槽位</a></td>
        </tr>
    </table>
</div>
<div class="modal fade parent-type" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title">新增钞箱组</h4>
            </div>
            <form method="post">
                <div class="modal-body">
                    <table style="width: 800px;">
                        <tr width="100%">
                            <td width="10%">&nbsp;</td>
                            <td width="20%">钞箱组编号</td>
                            <td><input  name = "no" type="text" placeholder="请输入钞箱组编号" class="form-control"/></td>
                        </tr>
                        <tr>
                            <td colspan="4">&nbsp;</td>
                        </tr>
                        <tr>
                            <td>&nbsp;</td>
                            <td>钞箱组名称</td>
                            <td><input type="text" name="name" placeholder="请输入钞箱组名称" class="form-control"/></td>
                        </tr>
                        <tr>
                            <td colspan="4">&nbsp;</td>
                        </tr>
                        <tr>
                            <td>&nbsp;</td>
                            <td>描述</td>
                            <td><textarea name="description" class="form-control" rows="3"></textarea></td>
                        </tr>
                    </table>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                    <input type="submit" value="Save changes" class="btn btn-primary"/>
                </div>
            </form>
        </div>
    </div>
</div>
<div th:each="unit:${cashboxUnits}" th:class="|modal fade child-type${unit.getId()}|" tabindex="-1" role="dialog"
     aria-labelledby="myLargeModalLabel">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title">钞箱组修改</h4>
            </div>
            <form method="post">
                <input type="hidden" value="上级项目的ID"/>
                <input type="hidden" name="id" th:value="${unit.getId()}"/>
                <div class="modal-body">
                    <table style="width: 800px;">
                        <tr width="100%">
                            <td width="10%">&nbsp;</td>
                            <td width="20%">钞箱组编号</td>
                            <td><input type="text" th:name="no" th:value="${unit.getNo()}" placeholder="请输入钞箱组编号"
                                       class="form-control" value="1"/></td>
                        </tr>
                        <tr>
                            <td colspan="4">&nbsp;</td>
                        </tr>
                        <tr>
                            <td>&nbsp;</td>
                            <td>钞箱组名称</td>
                            <td><input th:value="${unit.getName()}" th:name="name" type="text" placeholder="请输入钞箱组名称"
                                       class="form-control" value="1#"/></td>
                        </tr>
                        <tr>
                            <td colspan="4">&nbsp;</td>
                        </tr>
                        <tr>
                            <td>&nbsp;</td>
                            <td>描述</td>
                            <td><textarea class="form-control" th:value="${unit.getDescription()}" th:text="${unit.getDescription()}" th:name="description"
                                          rows="3">1#钞箱组</textarea></td>
                        </tr>
                    </table>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                    <input type="submit" value="Save changes" class="btn btn-primary"/>
                </div>
            </form>
        </div>
    </div>
</div>
<div th:each="unit:${cashboxUnits}" th:class="|modal fade denomination${unit.getId()}||" tabindex="-1" role="dialog"
     aria-labelledby="myLargeModalLabel">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" th:text="|${unit.getName()}钞箱组对应槽位查看|">1#钞箱组对应槽位查看</h4>
            </div>
            <input type="hidden" value="上级项目的ID"/>
            <div class="modal-body">
                <table class="table table-bordered" style="margin-bottom: 0px;">
                    <tr class="info" width="100%">
                        <th width="11%">槽位编号</th>
                        <th width="15%">对应钞箱编码</th>
                        <th width="7%">币种</th>
                        <th width="7%">面额</th>
                        <th>描述</th>
                    </tr>
                    <tr th:each="conf,iterstat:${unit.getConfs()}">
                        <td th:text="${conf.getSlotNo()}">1</td>
                        <td th:text="${conf.getCode()}">123456</td>
                        <td th:text="${conf.getCashName()}"> 美元</td>
                        <td th:text="${conf.getDenominationValue()}">5</td>
                        <td th:text="${conf.getDescription()}"></td>
                    </tr>
                </table>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>
